import request from '@/utils/request'

// 购物车接口
export async function getShoppingCart(params) {
  const res = await request({
    url: '/shopping-cart',
    method: 'post',
    data: params || {}
  })
  return res
}
// 购物车添加接口
export async function addShoppingCart(params) {
  const res = await request({
    url: '/shopping-cart/add',
    method: 'post',
    data: params || {}
  })
  return res
}
// 购物车更新接口
export async function updateShoppingCart(params) {
  const res = await request({
    url: '/shopping-cart/edit',
    method: 'post',
    data: params || {}
  })
  return res
}
// 购物车批量删除接口
export async function deleteShoppingCart(params) {
  const res = await request({
    url: '/shopping-cart/remove/batch',
    method: 'post',
    data: params || {}
  })
  return res
}

// 获取详情页购物车数量
export async function getCartNums(params) {
  const res = await request({
    url: '/shopping-cart/quantity',
    method: 'post',
    data: params || {}
  })
  return res
}
